
//6) Given an array of integers check the Palindrome of the series.

public class Palindrome {
 
        public static void main(String[] args) {
               
                //array of numbers to be checked
                int[] nums = new int[]{121,13,22122,343,11,23432,54};
               
                //iterate through the numbers
                for(int i=0; i < nums.length; i++){
                       
                        int num1 = nums[i];
                        int reversedNumber  = 0;
                        int result = 0;
                       
                        while(num1 > 0){
                                result = num1 % 10;
                                num1 = num1 / 10;
                                reversedNumber = reversedNumber * 10 + result;
                        }
                       
                        if(nums[i] == reversedNumber)
                                System.out.println(nums[i]);
                }
               
        }
}